<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>毕业设计项目</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<script type="text/javascript" src="../../js/jquery-1.9.0.js"></script>
<link href="../../css/style.css" rel="stylesheet" type="text/css">
<script src="../../script/common.js"></script>
</head>
<body>

<div class="page_title">客户信息管理 &gt; 客户信息 &gt; 历史订单 &gt; 订单明细 </div>
<div class="button_bar">
	<button class="common_button" onclick="help('');">帮助</button>
	<button class="common_button" onclick="back();">返回</button>  
</div>
<table class="query_form_table" height="59">
	<tr>
		<th>订单编号</th>
		<td id="odrId"></td>
		<th>日期</th>
		<td id="odrDate"></td>
	</tr>
	<tr>
		<th height="28">送货地址</th>
		<td id="odrAddr"></td>
		<th height="28">总金额（元）</th>
		<td id="totalP">55200</td>
	</tr>
	<tr>
		<th height="28">状态</th>
		<td id="odrStatus"></td>
		<th height="28">&nbsp;</th>
		<td>&nbsp;</td>
	</tr>
	</table>
<br />
<table class="data_list_table">
	<tr>
		<th>商品</th>
		<th>数量</th>
		<th>单位</th>
		<th>单价（元）</th>
		<th>金额（元）</th>
	</tr>

	<tbody id="showAll">

	</tbody>

	<!--<tr>
		<td class="list_data_text">海龙笔记本电脑-i60-2688 9966</td>
		<td class="list_data_ltext">2</td>
		<td class="list_data_text">台</td>
		<td class="list_data_text">10800</td>
		<td class="list_data_text">21600</td>
	</tr>
	<tr>
		<td class="list_data_text">海龙笔记本电脑-i61-2689 6688</td>
		<td class="list_data_ltext">2</td>
		<td class="list_data_text">台</td>
		<td class="list_data_text">16800</td>
		<td class="list_data_text">33600</td>
	</tr>-->
	</table>
</body>
</html>
<script type="text/javascript">
	$(function () {
	    UrlSearch();
    })

    function UrlSearch(){

        var name,value;
        var str=location.href; //取得整个地址栏
		//console.info(decodeURI(str));
        str=decodeURI(str);
        //console.info(str);
        var num=str.indexOf("?")
        str=str.substr(num+1); //取得所有参数   stringvar.substr(start [, length ]
        console.info(str);
        var split = str.split("&");
        var odrId=split[0].substr(split[0].indexOf("=")+1);
        var odrDate=split[1].substr(split[1].indexOf("=")+1);
        var odrAddr=split[2].substr(split[2].indexOf("=")+1);
        var odrStatus=split[3].substr(split[3].indexOf("=")+1);
        console.info(odrId);
        console.info(odrDate);
        console.info(odrAddr);
        console.info(odrStatus);
        $("#odrId").html(odrId);
        $("#odrDate").html(odrDate);
        $("#odrAddr").html(odrAddr);
        $("#odrStatus").html(odrStatus);
        showAllVProduct(odrId);
    }

    function showAllVProduct(odrId) {

        var totalP=0;
        $.ajax({
            url:"/VOrder/findVProductByOddOrderId",
            data:{"oddOrderId":odrId},
            dataType:'json',
            contentType:"application/json;charset=utf-8",
            success:function (vProuductList) {
//				alert(vProuductList);
                $.each(vProuductList,function (i,product) {
                    totalP+=(product.prodPrice*product.prodBatch);
                    var tr=//
                        "<tr>"+
                        "<td class='list_data_text'>"+product.prodName+"</td>"+
                        "<td class='list_data_text'>"+product.prodBatch+"</td>"+
                        "<td class='list_data_text'>"+product.prodUnit+"</td>"+
                        "<td class='list_data_text'>"+product.prodPrice+"</td>"+
                        "<td class='list_data_text'>"+(product.prodPrice*product.prodBatch)+"</td>"+
                        "</tr>";
                    $("#showAll").append(tr);
                });
                $("#totalP").html(totalP);
            }
        });
    }
</script>